<template>
  <el-main>

    <el-form :inline="true" class="demo-form-inline">

      <el-form-item label="公寓名称搜索">
        <el-input v-model="queryForm.name" clearable placeholder="请输入公寓名称关键字"></el-input>
      </el-form-item>
      <el-form-item label="日期查询：">
        <el-date-picker
          v-model="queryForm.borrowedStart"
          type="date" value-format="yyyy-MM-dd"
          placeholder="选择账期开始日期">
        </el-date-picker>
        ------
        <el-date-picker
          v-model="queryForm.borrowedEnd"
          type="date" value-format="yyyy-MM-dd"
          placeholder="选择账期结账日期">
        </el-date-picker>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onQuery">查询</el-button>
      </el-form-item>
    </el-form>

    <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column
        prop="factoringOrderNo"
        label="申请合同号">
      </el-table-column>
      <el-table-column
        prop="name"
        label="公寓名称">
      </el-table-column>
      <el-table-column
        prop="roomName"
        label="承租房间">
      </el-table-column>
      <el-table-column
        prop="tenantName"
        label="租客姓名">
      </el-table-column>
      <el-table-column
        prop="shouldMonthRent"
        label="应还保租金">
      </el-table-column>
      <el-table-column
        prop="borrowedStart"
        label="结账开始日">
      </el-table-column>
      <el-table-column
        prop="borrowedEnd"
        label="结账结账日">
      </el-table-column>
      <el-table-column
        prop="collectionDate"
        label="交租日期">
      </el-table-column>
      <el-table-column
        prop="capitalName"
        label="资金方">
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryForm.pageNo"
      :limit.sync="queryForm.pageSize"
      @pagination="getList"
    />


  </el-main>
</template>

<script>
  import {listbank} from "@/api/system/jinrong";
    export default {
        name: "zuyuelist",
      data() {
        return {
          tableData: [],
          queryForm:{
            pageNo:1,
            pageSize:50
          },
          total:0
        }
      },
      methods:{
        // //分页大小PageSize改变事件
        // handleSizeChange(pageSize) {
        //   console.log(pageSize)
        //   this.queryForm.pageSize = pageSize;
        //   //根据分页和查询条件 ajax请求后台列表数据 给tabledata给分页组件的变量赋值
        //   this.getList();
        // },
        // handleCurrentChange(pageNo) {
        //   console.log(pageNo)
        //   this.queryForm.pageNo = pageNo;
        //   //根据分页和查询条件ajax请求后台列表数据 给tabledata 给分页组件的变量赋值
        //   this.getList();
        // },
        onQuery(){
          this.getList();
        },
        getList() {
          listbank(this.queryForm).then(response => {
            console.log(response)
            this.tableData = response.data.list;
            this.total = response.data.total;
          });
        },
      },
      created() {
        this.getList();
      }
    }
</script>

<style scoped>

</style>
